package com.hmy.contract.service.contract;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hmy.ccp.common.response.BasePageResponse;
import com.hmy.contract.bo.request.contract.*;
import com.hmy.contract.bo.response.contract.*;
import com.hmy.contract.dal.po.ContractPo;

import java.util.List;

public interface IContractService extends IService<ContractPo> {


    /**
     * 租赁合同创建
     *
     * @param createLeaseContractRequest 合同创建入参
     * @return {@link CreateLeaseContractResponse}
     */
    CreateLeaseContractResponse createLeaseContract(CreateLeaseContractRequest createLeaseContractRequest);

    /**
     * 合同创建，通用接口
     *
     * @param createContractRequest 合同创建入参
     * @return {@link CreateLeaseContractResponse}
     */
    CreateContractResponse saveContract(CreateContractRequest createContractRequest);

    /**
     * 获取合同信息
     *
     * @param contractInfoRequest 获取合同信息入参
     * @return {@link ContractInfoResponse}
     */
    ContractInfoResponse contractInfo(ContractInfoRequest contractInfoRequest);

    /**
     * 通过合同任务id获取合同信息
     *
     * @param contractInfoRequest 通过合同任务id获取合同信息入参
     * @return {@link ContractInfoResponse}
     */
    ContractInfoResponse contractInfoBySignTaskId(ContractInfoRequest contractInfoRequest);

    /**
     * 通过合同任务id获取合同id
     *
     * @param signTaskId 合同任务id
     * @return 合同id
     */
    Long contractInfoBySignTaskId(String signTaskId);

    /**
     * 更新合同文件地址
     *
     * @param updateFileUrlRequest 更新合同文件地址入参
     * @return {@link UpdateFileUrlResponse}
     */
    UpdateFileUrlResponse updateFileUrl(UpdateFileUrlRequest updateFileUrlRequest);

    /**
     * 获取签约地址
     *
     * @param getSignUrlRequest 获取签约地址入参
     * @return {@link GetSignUrlResponse}
     */
    GetSignUrlResponse getSignUrl(GetSignUrlRequest getSignUrlRequest);

    /**
     * 分页查询
     *
     * @param contractPageRequest 分页查询入参
     * @return {@link ContractPageResponse}
     */
    BasePageResponse<ContractPageResponse> page(ContractPageRequest contractPageRequest);
    /**
     * 签约完成
     *
     * @param contractSignFinishedRequest 签约完成入参
     * @return {@link ContractInfoResponse}
     */
    ContractInfoResponse signFinished(ContractSignFinishedRequest contractSignFinishedRequest);

    /**
     * 创建合同，用于异步任务
     * @param contractId 合同id
     */
    void contractCreate(Long contractId);

    List<Long> getWaitingCreateContract(Long count);

    void updateContractStatusFailed(Long contractId);

    /**
     * 根据业务类型 合同编码名称或编号模糊查询合同列表
     */
    BasePageResponse<ContractQueryListResponse> pageQueryContract(ContractQueryListRequest request);

    GetContractInfoByRelationIdResponse getContractInfoByRelationId(GetContractInfoByRelationIdRequest request);
}
